EventTarget = function EventTarget(){}
Object.defineProperties(EventTarget.prototype,{
    addEventListener: {
        value:function addEventListener(){},
        writable: true,
        enumerable: true,
        configurable: true
    },
    dispatchEvent: {
        value:function dispatchEvent(){},
        writable: true,
        enumerable: true,
        configurable: true
    },
    removeEventListener: {
        value:function removeEventListener(){},
        writable: true,
        enumerable: true,
        configurable: true
    },
    when:{
        value:function when(eventName, callback){
            this.addEventListener(eventName, callback);
        },
        writable: true,
        enumerable: true,
        configurable: true
    }
})
Object.defineProperty(EventTarget.prototype, Symbol.toStringTag, {
    value: "EventTarget",
})
WindowProperties = function WindowProperties(){}

Object.setPrototypeOf(WindowProperties.prototype, EventTarget.prototype)

Object.defineProperty(WindowProperties.prototype,Symbol.toStringTag,{
    value: "WindowProperties"
})
delete WindowProperties.prototype.constructor;


Window = function Window(){}
Object.setPrototypeOf(Window,EventTarget)
Object.setPrototypeOf(Window.prototype, WindowProperties.prototype)

Object.defineProperties(Window, {  // ← 注意这里是 Window，不是 Window.prototype
    PERSISTENT: {
        value: 1,
        configurable: true,
        enumerable: true,
        writable: false
    },
    TEMPORARY: {
        value: 0,
        configurable: true,
        enumerable: true,
        writable: false
    }
});
Object.defineProperties(Window.prototype,{
    PERSISTENT: {
        value: 1,
        configurable: true,
        enumerable: true,
        writable: false
    },
    TEMPORARY: {
        value: 0,
        configurable: true,
        enumerable: true,
        writable: false
    }
})
Object.defineProperty(Window.prototype,Symbol.toStringTag,{
    value: "Window"
})

debugger;